<%@page import="java.util.Date"%>
<%@page import="itsm.isperp.framework.core.context.ContextHolder"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<jsp:include page="../common/top.jsp"></jsp:include>

<script type="text/javascript">
   $("#customerOpinion").text("");
	function saveSatisfaction() {

		var satisfaction = $("input[name='satisfaction']:checked").val();

		if (satisfaction == "" || satisfaction == undefined) {
			alert("请选择满意度！");
			return false;
		}

		if (satisfaction == "5" || satisfaction == "2" || satisfaction == "1") {
			var customerOpinion = $("#customerOpinion").val();
			if (customerOpinion == "" || customerOpinion == undefined) {
				alert("评价非常满意/不满意/不评价，请务必填写客户意见。");
				return false;
			}
		}

		$("#processBtn").html("提交评分中...");
		$("#saveSatisfactionForm").submit();
	}
	
</script>
<div class="box_title">请您评价工程师本次处理结果</div>
<div class="ui-body">

	<form:form commandName="model" cssClass="validate"
		id="saveSatisfactionForm"
		action="customer/help/incident/saveSatisfaction">
		<div style="display: none">
			<input type="hidden" name="openid" value="${openid }"> <input
				name="id" type="hidden" value="${model.id }"><input
				type="hidden" name="processId" value="${model.processId }">
		</div>
		<table class="form-table">
			<tr style="">
				<td colspan="2">
					<div id="processBtn" style="text-align: center;padding:10px;">
						<button type="button" onclick="saveSatisfaction();" value="" style="line-height:14px;">提交评分</button>
					</div>
				</td>
			</tr>
			<tr>
				<td class="td1"><label>满意度(5分为满分)：</label></td>
				<td id="satisficationsTd"><form:radiobuttons
						path="satisfaction" cssStyle="width:18px;margin-left:8px;border:1px solid #cacaca"
						items="${satisfications}" itemLabel="name" itemValue="code" />
					&nbsp;&nbsp;</td>
			</tr>
			<tr>
				<td class="td1"><label for="textarea">客户意见：</label>
				</td>
				<td class="td2"><form:textarea path="customerOpinion"
						cssClass="required" /> <span class="required-tip"><font
						color="red"> * </font><font color="blue">必填 </font> </span> <br>（评价完成后直接关闭；评价非常满意/不满意/不评价，请填写客户意见。）</td>
			</tr>

		</table>
	</form:form> 

</div>

<div class="ui-body">
	<jsp:include page="basicInfo.jsp"></jsp:include>
</div>

<jsp:include page="../common/bottom.jsp"></jsp:include>